<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="warehousingRecordId" name="warehousingRecordId" th:value="${warehousingRecordVo.warehousingRecordId}"  type="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                产品：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-6">
                                <input id="productId" name="productId" th:value="${warehousingRecordVo.productId}" type="hidden">
                                <input id="productName" class="form-control" type="text" th:value="${warehousingRecordVo.productName}" required placeholder="产品（必填）"
                                       readonly>
                            </div>
                            <a class="btn btn-primary col-sm-2" onclick="productSelect()">选择产品</a>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                生产日期：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="produceDate" name="produceDate" class="form-control" type="date"  required
                                       placeholder="生产日期（必填）">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                入库数量：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="lastNum" name="lastNum" th:value="${warehousingRecordVo.number}" type="hidden">
                                <input name="number" class="form-control" th:value="${warehousingRecordVo.number}" type="digits" required
                                       placeholder="入库数量（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                批次(采用时间加3位数字如20190514001)：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input name="batch" class="form-control" th:value="${warehousingRecordVo.batch}" type="digits" required
                                       placeholder="批次（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">检测图片：</label>
                            <div class="col-sm-8">
                                <input name="file" class="form-control"  type="file">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                生产车间：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input name="workshop" class="form-control" th:value="${warehousingRecordVo.workshop}" type="text" required
                                       placeholder="车间（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                仓库：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input name="stockName" class="form-control" th:value="${warehousingRecordVo.stockName}" type="text" required
                                       placeholder="仓库（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">
                                入库日期：
                                <span style="color: #e7262a">*</span>
                            </label>
                            <div class="col-sm-8">
                                <input id="inStockDate" name="inStockDate" class="form-control" type="date" required
                                       placeholder="入库日期（必填）">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注：</label>
                            <div class="col-sm-8">
                                <input name="mark" class="form-control" th:value="${warehousingRecordVo.mark}" type="text" placeholder="备注">
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:inline="javascript">
    function formatDate() {
        var produceDate = [[${warehousingRecordVo.produceDate}]];
        if(produceDate != null){
            produceDate = produceDate.substring(0,10)
        }
        $("#produceDate").val(produceDate)

        var inStockDate = [[${warehousingRecordVo.inStockDate}]];
        if (inStockDate != null){
            inStockDate = inStockDate.substring(0,10)
        }

        $("#inStockDate").val(inStockDate);
    }

</script>
<script type="text/javascript" th:src="@{/js/appjs/stock/edit.js}" src="/static/js/appjs/stock/add.js">
</script>
</body>
</html>
